import {Provider} from 'react-redux';
import React from 'react';
import {View, StyleSheet, ActivityIndicator} from 'react-native';
import {PersistGate} from "redux-persist/integration/react";

import {colors} from './src/styles';
import {store, persistor} from './src/store';
import AppView from './src/modules/AppViewContainer';

import {Toast} from "./src/components/AroToast";

export default function App() {
  return (
    <Provider store={store}>
      <PersistGate
        loading={(
          <View style={styles.container}>
            <ActivityIndicator color={colors.green}/>
          </View>
        )}
        persistor={persistor}
      >
        <AppView/>
        <Toast/>
      </PersistGate>
    </Provider>
  );
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
    backgroundColor: 'white',
  },
});